package com.han.school.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.han.school.mapper.IronMapper;
import com.han.school.pojo.Book;
import com.han.school.pojo.Iron;
import com.han.school.service.IronService;
import com.han.school.vo.BookVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IronMapperImpl implements IronService {
    @Autowired
    IronMapper ironMapper;

    @Override
    public Integer addiron(String name) {
        Integer addiron = ironMapper.addiron(name);
        return addiron;
    }

    @Override
    public List<Iron> select() {
        List<Iron> select = ironMapper.select();
        return select;
    }



    @Override
    public Integer addbook(Book book) {
        Integer addbook = ironMapper.addbook(book);
        return addbook;
    }

    @Override
    public Integer upcheck(BookVo bookVo) {
        Integer upcheck = ironMapper.upcheck(bookVo);
        return upcheck;
    }

    @Override
    public Integer upcheck1(BookVo bookVo) {
        Integer integer = ironMapper.upcheck1(bookVo);
        return integer;
    }

    @Override
    public Integer delss(BookVo bookVo) {
        Integer delss = ironMapper.delss(bookVo);
        return delss;
    }

    @Override
    public PageInfo<BookVo> seletall(BookVo bookVo) {
        PageHelper.startPage(bookVo.getPage(),bookVo.getLimit());
        List<BookVo> seletall = ironMapper.seletall();
        return new PageInfo<>(seletall);
    }

    @Override
    public Integer updatebook(BookVo bookVo) {
        return ironMapper.updatebook(bookVo);
    }

    @Override
    public Integer deletebook(Book book) {
        return ironMapper.deletebook(book);
    }
}
